import axiosInstance from "@/services/http";
import type { Result } from "@/types";

export async function getEmailCode(email: string): Promise<Result<string>> {
    return await axiosInstance.get("/common/getEmailCode", { params: { email } });
};

export async function upload(file: File): Promise<Result<string>> {
    const formData = new FormData();
    formData.append('file', file);
    return await axiosInstance.post("/common/upload", formData, {
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    });
};